package com.jeesite.modules.isys.task;

import cn.hutool.json.JSONUtil;
import com.jeesite.modules.isys.iac.entity.IACMeta;
import com.jeesite.modules.isys.iac.service.IACService;
import com.jeesite.modules.isys.utils.IACMetaUtil;
import com.jeesite.modules.isys.xmqtt.client.XmqttClient;
import com.jeesite.modules.isys.xmqtt.entity.QosEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class GenIacTask {

    @Autowired
    private XmqttClient xmqttClient;

    private static final String  topic = "testtopic/1";

    @Scheduled(fixedRate = 1000)
    public void reportCurrentTimeWithFixedRate() {
//        IACMeta iacMeta = IACMetaUtil.generateRandomIACMeta();
//        xmqttClient.publish(topic, JSONUtil.toJsonStr(iacMeta), QosEnum.Qos0,false);
    }
}

